package pro.softzhang.algo.lc1000;

import pro.softzhang.algo.flag.difficulty.DGreen;

import java.util.ArrayList;
import java.util.List;

@DGreen
public class LC1431_KidsWithTheGreatestNumberOfCandies {
    public static void main(String[] args) {

    }

    static class Solution {
        public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
            int maxCandies = candies[0];
            for (int i = 1; i < candies.length; i++) {
                if (candies[i] > maxCandies) maxCandies = candies[i];
            }
            List<Boolean> l = new ArrayList<>(candies.length);
            for (int candy : candies) {
                l.add(candy + extraCandies >= maxCandies);
            }
            return l;
        }
    }
}
